using System.ComponentModel.DataAnnotations;
using Snowflake.Core;

namespace LowCoding.Dto.Sys
{
    /// <summary>
    /// 用户表
    /// </summary>
    public class SysUserInput
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        /// <example></example>
        public string Id { get; set; } = new IdWorker(1, 1).NextId().ToString();

        /// <summary>
        /// 公司ID
        /// </summary>
        /// <example></example>
        public string UsrFltId { get; set; }

        /// <summary>
        /// 部门ID
        /// </summary>
        /// <example></example>
        public string UsrDptId { get; set; }

        /// <summary>
        /// 用户代码
        /// </summary>
        /// <example></example>
        [Required(ErrorMessage = "用户代码不能为空")]
        [MaxLength(36, ErrorMessage = "用户代码输入字符过长")]
        public string UsrCode { get; set; }

        /// <summary>
        /// 用户名称
        /// </summary>
        /// <example></example>
        [Required(ErrorMessage = "用户名称不能为空")]
        [MaxLength(36, ErrorMessage = "用户名称输入字符过长")]
        public string UsrName { get; set; }

        /// <summary>
        /// 用户密码
        /// </summary>
        /// <example></example>
        public string UsrPassword { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        /// <example></example>
        [MaxLength(30, ErrorMessage = "联系电话输入字符过长")]
        public string UsrCellphone { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        /// <example></example>
        [MaxLength(50, ErrorMessage = "邮箱输入字符过长")]
        public string UsrEmail { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        /// <example></example>
        public string UsrStatus { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        /// <example></example>
        [MaxLength(400, ErrorMessage = "备注输入字符过长")]
        public string Remark { get; set; }

        /// <summary>
        /// 角色
        /// </summary>
        [Required(ErrorMessage = "角色不能为空")]
        public string UsrRole { get; set; }

        /// <summary>
        /// 是否有效
        /// </summary>
        public string USRVALIDITY { get; set; }

        /// <summary>
        /// 员工类型
        /// </summary>
        public string USRTYPE { get; set; }

        /// <summary>
        /// 确认密码
        /// </summary>
        public string UsrPasswordSure { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        [MaxLength(30, ErrorMessage = "部门名称输入字符过长")]
        public string UsrDptName { get; set; }
        public string Creator { get; set; }
        public string Lastmodifier { get; set; }
    }

    public class SysUserPortalInput : PagedSearchBase
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        /// <example></example>
        public string Id { get; set; }

        /// <summary>
        /// 公司ID
        /// </summary>
        /// <example></example>
        public string UsrFltId { get; set; }

        /// <summary>
        /// 部门ID
        /// </summary>
        /// <example></example>
        public string UsrDptId { get; set; }

        /// <summary>
        /// 用户代码
        /// </summary>
        /// <example></example>
        //[Required(ErrorMessage = "用户代码不能为空")]
        public string UsrCode { get; set; }

        /// <summary>
        /// 用户名称
        /// </summary>
        /// <example></example>
        //[Required(ErrorMessage = "用户名称不能为空")]
        public string UsrName { get; set; }

        /// <summary>
        /// 用户密码
        /// </summary>
        /// <example></example>
        public string UsrPassword { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        /// <example></example>
        public string UsrCellphone { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        /// <example></example>
        public string UsrEmail { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        /// <example></example>
        public string UsrStatus { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        /// <example></example>
        public string Remark { get; set; }

        /// <summary>
        /// 角色
        /// </summary>
        //[Required(ErrorMessage = "角色不能为空")]
        public string UsrRole { get; set; }

        /// <summary>
        /// 是否有效
        /// </summary>
        public string USRVALIDITY { get; set; }

        /// <summary>
        /// 员工类型
        /// </summary>
        public string USRTYPE { get; set; }

        public string Creator { get; set; }

        public string Lastmodifier { get; set; }
    }

    /// <summary>
    /// 修改密码
    /// </summary>
    public class EditPasswordInput
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        /// <example></example>
        public string UserId { get; set; }

        /// <summary>
        /// 旧密码
        /// </summary>
        public string UsrPasswordOld { get; set; }

        /// <summary>
        /// 新密码
        /// </summary>
        public string UsrPasswordNew { get; set; }

        /// <summary>
        /// 确认密码
        /// </summary>
        public string UsrPasswordSure { get; set; }
    }
}